
import com.msb.bean.User;
import com.msb.service.impl.UserService;
import com.msb.service.impl.UserServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {
    @Test
    public void testGetBean(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationcontext.xml");
        //User user = context.getBean("user1", User.class);
        //System.out.println(user);
        UserService userService = context.getBean("userServiceImpl", UserServiceImpl.class);
        userService.add();
        System.out.println(userService);
    }
}
